import { axios } from '@/utils/request'

/**
 * 查询租户套餐列表
 * @param query
 * @returns {AxiosPromise}
 */
export function pageTenantPackage(query) {
  return axios({
    url: '/system/tenant/package/page',
    method: 'get',
    params: query
  });
}

/**
 * 查询租户套餐下拉选列表
 * @returns {AxiosPromise}
 */
export function selectTenantPackage() {
  return axios({
    url: '/system/tenant/package/selectList',
    method: 'get'
  });
}

/**
 * 查询租户套餐详细
 * @param packageId
 * @returns {AxiosPromise}
 */
export function getTenantPackage(packageId) {
  return axios({
    url: '/system/tenant/package/' + packageId,
    method: 'get'
  });
}

/**
 * 新增租户套餐
 * @param data
 * @returns {*}
 */
export function addTenantPackage(data) {
  return axios({
    url: '/system/tenant/package',
    method: 'post',
    data: data
  });
}

/**
 * 修改租户套餐
 * @param data
 * @returns {AxiosPromise}
 */
export function updateTenantPackage(data) {
  return axios({
    url: '/system/tenant/package',
    method: 'put',
    data: data
  });
}

/**
 * 租户套餐状态修改
 * @param packageId
 * @param status
 * @returns {*}
 */
export function changePackageStatus(packageId, status) {
  const data = {
    packageId,
    status
  };
  return axios({
    url: '/system/tenant/package/changeStatus',
    method: 'put',
    data: data
  });
}

/**
 * 删除租户套餐
 * @param packageId
 * @returns {*}
 */
export function delTenantPackage(packageId) {
  return axios({
    url: '/system/tenant/package/' + packageId,
    method: 'delete'
  });
}
